//
// Created by francklinson on 2021/10/21 AT 10:41.
//
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <functional>
#include <climits>
#include <string>

using namespace std;

class Solution {
public:
    vector<int> buildArray(vector<int> &nums) {
        vector<int>ans(nums.size(),0);
        for (int i = 0; i < nums.size(); ++i) {
            ans[i] = nums[nums[i]];
        }
        return ans;
    }
};

int main() {
    vector<int> nums{0, 2, 1, 5, 3, 4};
    Solution solution;
    vector<int> ret = solution.buildArray(nums);
    for (auto &x: ret)cout << x << endl;
    return 0;
}

